drop table if exists jms_dm.dm_agent_taking_arrival_agg_dt;
create external table jms_dm.dm_agent_taking_arrival_agg_dt (
    import_date                 string  comment '日期'
    ,ordersource_code           string  comment '订单来源code'
    ,agent_code                 string  comment '代理区code'
    ,ordersource_name           string  comment '订单来源名称'
    ,agent_name                 string  comment '代理区名称'
    ,taking_cnt                 bigint  comment '收件量'
    ,arrival_cnt                bigint  comment '到件量'
)
comment  '代理区收件、到件汇总'
    partitioned by (dt string comment '时间分区')
    stored as parquet
    location '/dw/hive/jms_dm.db/external/dm_agent_taking_arrival_agg_dt'
    tblproperties (
      'parquet.column.index.access'= 'true'
);

msck repair table jms_dm.dm_agent_taking_arrival_agg_dt;